//
//  main.c
//  smallerNumbersThanCurrent
//
//  Created by edz on 2020/7/2.
//  Copyright © 2020 edz. All rights reserved.
//

#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    printf("Hello, World!\n");
    return 0;
}

//1365. 有多少小于当前数字的数字

int* smallerNumbersThanCurrent(int* nums, int numsSize, int* returnSize){
    int *result = (int *)malloc(sizeof(int) * numsSize);
    for(int i = 0; i < numsSize;i++){
        result[i] = 0;
        for(int j = 0; j < numsSize;j++){
                if(nums[j] < nums[i]){
                    result[i]++;
                    *returnSize = numsSize;
                }
        }
    }
    return result;
}
